package com.sxl.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sxl.domain.MenuInfo;
import com.sxl.domain.Modules;
import com.sxl.service.ModulesService;
import com.sxl.mapper.ModulesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author xue
* @description 针对表【modules】的数据库操作Service实现
* @createDate 2022-04-18 16:12:16
*/
@Service
public class ModulesServiceImpl extends ServiceImpl<ModulesMapper, Modules>
    implements ModulesService{
    @Autowired
    private ModulesMapper modulesMapper;
    @Override
    public List<Modules> findOneLevel() {
        return modulesMapper.findOneLevel();
    }

    @Override
    public int findIsHvaeSon(Integer id) {
        return modulesMapper.findIsHvaeSon(id);
    }

    @Override
    public int findIsHaveModules(Integer id) {
        return modulesMapper.findIsHaveModules(id);
    }

    @Override
    public List<Modules> selectAllByParentId(Integer parentId) {
        return modulesMapper.selectAllByParentId(parentId);
    }
    @Override
    public List<MenuInfo> initMenu(Integer id, String type) {
        return modulesMapper.initMenu(id,type);
    }
}




